<!DOCTYPE html>
<html>
<head>
    <meta charset='UTF-8'>
    <title>Document</title>
</head>
<body>
<div id="rw">
    <button v-on:click='say("你好")'>你好！</button>
    <button v-on:click='say("迪迦奥特曼")'>迪迦奥特曼</button>
    <button v-on:click='warn("哎呀，表单提交好像出错了~",$event)'>提交</button>
</div>
</body>
<script src="../vue.js"></script>
<script>
new Vue({
    el:"#rw",
    methods:{
        say: function(message){
            alert(message)
        },
        warn: function(message,event){
            if (event) {
                event.preventDefault()
            };
            alert (message)
        }
    }
})
</script>
</html>